-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read server response on DATA command #190
Conversation
I came here with the exact same dilemma -- I need to capture & log the The semantics of returning an But I'll gladly take this as well. Any indication of whether this is going to be accepted? |
@Slugger then I can simply add the same functionality as a callback function in LMTP session. |
I like this approach better for sure. Now I can handle the |
@emersion kindly ping |
Sorry for the delay. I think in general I'm not a huge fan of callbacks... Could we instead turn the returned |
Agreed with emersion, I think adding an explicit method looks like better design to me. I am also not sure if SMTPError is the right type to use here, I would at least create an alias named SMTPResponse or something - some careful refactoring may be needed here. |
Do we really need to expose the full response? Is there anything interesting in there apart from the human-readable message? |
Usually a message ID from the upstream receiver. My use case at the time was that I was trying to use this as a piece in an email forwarding service and when I forwarded messages upstream I wanted to capture the message id from the receiver for logging, tracking and auditing purposes. |
Closing in favor of #263 |
This is a braking change. Now
Data()
method will accept a callaback function andLMTPData()
method callbacks will receive success statuses instead nil. Therefore dependentLMTPData
code must check for status response code.Resolves #189
P.S. I rewrote the
(d *dataCloser) Close()
code to make it more readable.